<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <title>技能交换 - 社交圈</title>
    <!-- Bootstrap 5 CSS -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
    <!-- Font Awesome 图标 -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css">
    
    <style>
        :root {
            --primary: #10b981;
            --primary-light: #34d399;
            --primary-dark: #059669;
            --secondary: #6366f1;
            --light: #f8fafc;
            --dark: #1e293b;
            --gray: #94a3b8;
            --border: #e2e8f0;
            --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
        }
        
        body {
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
            background-color: #f5f7fa;
            color: var(--dark);
            padding-top: 56px;
            padding-bottom: 70px;
        }
        
        /* 顶部导航 */
        .top-nav {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            height: 56px;
            background-color: white;
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0 16px;
            border-bottom: 1px solid var(--border);
            z-index: 1000;
        }
        
        .nav-title {
            font-size: 1.1rem;
            font-weight: 600;
        }
        
        .nav-btn {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--dark);
            background: transparent;
            border: none;
        }
        
        .nav-btn:hover {
            background-color: var(--light);
        }
        
        /* 搜索栏 */
        .search-container {
            padding: 12px 16px;
            background-color: white;
            border-bottom: 1px solid var(--border);
        }
        
        .search-group {
            position: relative;
        }
        
        .search-input {
            width: 100%;
            padding: 10px 16px 10px 40px;
            border-radius: 8px;
            border: 1px solid var(--border);
            background-color: var(--light);
            font-size: 0.9rem;
        }
        
        .search-icon {
            position: absolute;
            left: 14px;
            top: 50%;
            transform: translateY(-50%);
            color: var(--gray);
        }
        
        /* 筛选标签 */
        .filter-tags {
            display: flex;
            overflow-x: auto;
            padding: 8px 16px;
            gap: 8px;
            background-color: white;
            border-bottom: 1px solid var(--border);
        }
        
        .filter-tag {
            white-space: nowrap;
            padding: 6px 14px;
            border-radius: 20px;
            font-size: 0.85rem;
            background-color: var(--light);
            color: var(--dark);
            border: 1px solid var(--border);
            flex-shrink: 0;
        }
        
        .filter-tag.active {
            background-color: var(--primary);
            color: white;
            border-color: var(--primary);
        }
        
        /* 视图切换 */
        .view-controls {
            padding: 8px 16px;
            background-color: white;
            display: flex;
            justify-content: space-between;
            align-items: center;
            border-bottom: 1px solid var(--border);
        }
        
        .view-label {
            font-size: 0.85rem;
            color: var(--gray);
        }
        
        .view-options {
            display: flex;
            gap: 8px;
        }
        
        .view-btn {
            width: 34px;
            height: 34px;
            border-radius: 6px;
            border: 1px solid var(--border);
            background-color: var(--light);
            color: var(--gray);
            display: flex;
            align-items: center;
            justify-content: center;
        }
        
        .view-btn.active {
            background-color: var(--primary);
            color: white;
            border-color: var(--primary);
        }
        
        /* 技能交换列表 */
        .exchange-list {
            padding: 12px;
        }
        
        /* 技能卡片基础样式 */
        .skill-card {
            background-color: white;
            border-radius: 12px;
            overflow: hidden;
            margin-bottom: 12px;
            box-shadow: var(--shadow);
            transition: transform 0.2s;
        }
        
        .skill-card:hover {
            transform: translateY(-2px);
        }
        
        /* 无图样式 */
        .no-media .media-area {
            padding: 16px;
            background-color: var(--light);
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            color: var(--primary);
        }
        
        .skill-icon {
            font-size: 3rem;
            margin-bottom: 8px;
        }
        
        .skill-category {
            font-size: 0.9rem;
            font-weight: 500;
        }
        
        /* 单图样式 */
        .single-media .media-area {
            height: 180px;
            position: relative;
        }
        
        .media-img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
        
        /* 多图样式 */
        .multiple-media .media-area {
            height: 180px;
        }
        
        .media-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            grid-template-rows: repeat(2, 1fr);
            height: 100%;
            gap: 2px;
        }
        
        .grid-img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
        
        .more-media {
            grid-column: span 2;
            background-color: rgba(0,0,0,0.5);
            color: white;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.9rem;
        }
        
        /* 卡片内容区 */
        .card-content {
            padding: 14px;
        }
        
        .user-info {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 10px;
        }
        
        .avatar-name {
            display: flex;
            align-items: center;
            gap: 10px;
        }
        
        .user-avatar {
            width: 44px;
            height: 44px;
            border-radius: 50%;
            object-fit: cover;
        }
        
        .user-name {
            font-weight: 600;
            font-size: 1rem;
        }
        
        .user-meta {
            font-size: 0.8rem;
            color: var(--gray);
        }
        
        .distance {
            font-size: 0.8rem;
            color: var(--gray);
            background-color: var(--light);
            padding: 2px 8px;
            border-radius: 10px;
        }
        
        /* 技能信息 */
        .skill-info {
            margin-bottom: 12px;
        }
        
        .skill-title {
            font-weight: 600;
            font-size: 1.05rem;
            margin-bottom: 6px;
            color: var(--dark);
        }
        
        .skill-description {
            font-size: 0.9rem;
            color: var(--dark);
            line-height: 1.4;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
            margin-bottom: 10px;
        }
        
        /* 技能标签 */
        .skills-exchange {
            display: flex;
            gap: 8px;
            margin-bottom: 12px;
        }
        
        .skill-offer, .skill-seek {
            flex: 1;
            padding: 8px;
            border-radius: 8px;
        }
        
        .skill-offer {
            background-color: rgba(16, 185, 129, 0.1);
            border: 1px solid var(--primary-light);
        }
        
        .skill-seek {
            background-color: rgba(99, 102, 241, 0.1);
            border: 1px solid var(--secondary);
        }
        
        .skill-label {
            font-size: 0.75rem;
            color: var(--gray);
            margin-bottom: 4px;
        }
        
        .skill-tags {
            display: flex;
            flex-wrap: wrap;
            gap: 4px;
        }
        
        .skill-tag {
            font-size: 0.8rem;
            padding: 2px 8px;
            border-radius: 4px;
        }
        
        .offer-tag {
            background-color: rgba(16, 185, 129, 0.2);
            color: var(--primary-dark);
        }
        
        .seek-tag {
            background-color: rgba(99, 102, 241, 0.2);
            color: var(--secondary);
        }
        
        /* 卡片底部 */
        .card-actions {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding-top: 10px;
            border-top: 1px solid var(--border);
        }
        
        .post-time {
            font-size: 0.8rem;
            color: var(--gray);
        }
        
        .contact-btn {
            padding: 6px 14px;
            background-color: var(--primary);
            color: white;
            border: none;
            border-radius: 8px;
            font-size: 0.9rem;
            font-weight: 500;
            transition: background-color 0.2s;
        }
        
        .contact-btn:hover {
            background-color: var(--primary-dark);
        }
        
        /* 列表视图样式 */
        .list-view .skill-card {
            display: flex;
            height: 140px;
        }
        
        .list-view .media-area {
            width: 120px;
            height: 100%;
            flex-shrink: 0;
        }
        
        .list-view .single-media .media-area,
        .list-view .multiple-media .media-area,
        .list-view .no-media .media-area {
            height: 100%;
        }
        
        .list-view .card-content {
            flex: 1;
            padding: 10px;
            display: flex;
            flex-direction: column;
        }
        
        .list-view .skill-description,
        .list-view .post-time {
            display: none;
        }
        
        .list-view .card-actions {
            margin-top: auto;
            padding-top: 8px;
        }
        
        /* 网格视图样式 */
        .grid-view .exchange-list {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 12px;
        }
        
        .grid-view .media-area {
            height: 120px;
        }
        
        .grid-view .skill-title {
            font-size: 0.9rem;
            margin-bottom: 4px;
        }
        
        .grid-view .skill-description,
        .grid-view .user-meta,
        .grid-view .post-time {
            display: none;
        }
        
        .grid-view .skills-exchange {
            margin-bottom: 8px;
        }
        
        .grid-view .skill-tag {
            font-size: 0.7rem;
            padding: 1px 6px;
        }
        
        .grid-view .contact-btn {
            width: 100%;
            padding: 5px 0;
            text-align: center;
            font-size: 0.8rem;
        }
        
        /* 底部导航 */
        .bottom-nav {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            height: 65px;
            background-color: white;
            display: flex;
            justify-content: space-around;
            align-items: center;
            border-top: 1px solid var(--border);
            z-index: 1000;
        }
        
        .nav-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            color: var(--gray);
            font-size: 0.7rem;
            text-decoration: none;
        }
        
        .nav-item i {
            font-size: 1.25rem;
            margin-bottom: 4px;
        }
        
        .nav-item.active {
            color: var(--primary);
        }
        
        /* 悬浮按钮 */
        .floating-btn {
            position: fixed;
            right: 20px;
            bottom: 85px;
            width: 56px;
            height: 56px;
            border-radius: 50%;
            background-color: var(--primary);
            color: white;
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
            border: none;
            font-size: 1.5rem;
            z-index: 900;
        }
        
        /* 提示消息 */
        .toast {
            position: fixed;
            top: 60px;
            left: 50%;
            transform: translateX(-50%);
            background-color: rgba(0, 0, 0, 0.7);
            color: white;
            padding: 8px 16px;
            border-radius: 4px;
            font-size: 0.9rem;
            z-index: 9999;
            opacity: 0;
            transition: opacity 0.3s ease;
        }
        
        .toast.show {
            opacity: 1;
        }
    </style>
</head>
<body>
    <!-- 顶部导航 -->
    <div class="top-nav">
        <button class="nav-btn" id="backBtn">
            <i class="fas fa-arrow-left"></i>
        </button>
        <div class="nav-title">技能交换</div>
        <button class="nav-btn" id="filterBtn">
            <i class="fas fa-filter"></i>
        </button>
    </div>
    
    <!-- 搜索栏 -->
    <div class="search-container">
        <div class="search-group">
            <i class="fas fa-search search-icon"></i>
            <input type="text" class="search-input" placeholder="搜索技能、兴趣或用户...">
        </div>
    </div>
    
    <!-- 筛选标签 -->
    <div class="filter-tags">
        <div class="filter-tag active">全部技能</div>
        <div class="filter-tag">语言学习</div>
        <div class="filter-tag">音乐艺术</div>
        <div class="filter-tag">运动健身</div>
        <div class="filter-tag">厨艺美食</div>
        <div class="filter-tag">编程开发</div>
        <div class="filter-tag">设计创意</div>
        <div class="filter-tag">手工制作</div>
    </div>
    
    <!-- 视图切换 -->
    <div class="view-controls">
        <div class="view-label">展示方式</div>
        <div class="view-options">
            <button class="view-btn active" data-view="card" title="卡片视图">
                <i class="fas fa-th-large"></i>
            </button>
            <button class="view-btn" data-view="list" title="列表视图">
                <i class="fas fa-list"></i>
            </button>
            <button class="view-btn" data-view="grid" title="网格视图">
                <i class="fas fa-th"></i>
            </button>
        </div>
    </div>
    
    <!-- 技能交换列表 -->
    <div class="exchange-list">
        <!-- 多图技能卡片 -->
        <div class="skill-card multiple-media">
            <div class="media-area">
                <div class="media-grid">
                    <img src="https://picsum.photos/id/431/300/300" alt="烘焙作品" class="grid-img">
                    <img src="https://picsum.photos/id/292/300/300" alt="烘焙过程" class="grid-img">
                    <img src="https://picsum.photos/id/493/300/300" alt="蛋糕展示" class="grid-img">
                    <div class="more-media">+2</div>
                </div>
            </div>
            
            <div class="card-content">
                <div class="user-info">
                    <div class="avatar-name">
                        <img src="https://picsum.photos/id/64/100/100" alt="林小厨" class="user-avatar">
                        <div>
                            <div class="user-name">林小厨</div>
                            <div class="user-meta">烘焙师 • 26岁</div>
                        </div>
                    </div>
                    <div class="distance">1.2公里</div>
                </div>
                
                <div class="skill-info">
                    <div class="skill-title">专业烘焙技巧分享</div>
                    <div class="skill-description">
                        5年烘焙经验，擅长蛋糕、面包和甜点制作，可教授从基础到进阶的烘焙技巧，提供材料选购建议。
                    </div>
                    
                    <div class="skills-exchange">
                        <div class="skill-offer">
                            <div class="skill-label">我能提供</div>
                            <div class="skill-tags">
                                <span class="skill-tag offer-tag">蛋糕制作</span>
                                <span class="skill-tag offer-tag">面包烘焙</span>
                                <span class="skill-tag offer-tag">裱花技巧</span>
                            </div>
                        </div>
                        
                        <div class="skill-seek">
                            <div class="skill-label">我想学习</div>
                            <div class="skill-tags">
                                <span class="skill-tag seek-tag">英语口语</span>
                                <span class="skill-tag seek-tag">吉他入门</span>
                            </div>
                        </div>
                    </div>
                </div>
                
                <div class="card-actions">
                    <div class="post-time">发布于 2小时前</div>
                    <button class="contact-btn">联系TA</button>
                </div>
            </div>
        </div>
        
        <!-- 无图技能卡片 -->
        <div class="skill-card no-media">
            <div class="media-area">
                <div class="skill-icon">
                    <i class="fas fa-code"></i>
                </div>
                <div class="skill-category">编程开发</div>
            </div>
            
            <div class="card-content">
                <div class="user-info">
                    <div class="avatar-name">
                        <img src="https://picsum.photos/id/91/100/100" alt="张程序" class="user-avatar">
                        <div>
                            <div class="user-name">张程序</div>
                            <div class="user-meta">全栈开发者 • 30岁</div>
                        </div>
                    </div>
                    <div class="distance">3.5公里</div>
                </div>
                
                <div class="skill-info">
                    <div class="skill-title">Web开发教学（前端/后端）</div>
                    <div class="skill-description">
                        8年开发经验，可教授HTML/CSS/JavaScript、React、Vue等前端技术，以及Node.js后端开发。
                    </div>
                    
                    <div class="skills-exchange">
                        <div class="skill-offer">
                            <div class="skill-label">我能提供</div>
                            <div class="skill-tags">
                                <span class="skill-tag offer-tag">前端开发</span>
                                <span class="skill-tag offer-tag">后端开发</span>
                                <span class="skill-tag offer-tag">小程序开发</span>
                            </div>
                        </div>
                        
                        <div class="skill-seek">
                            <div class="skill-label">我想学习</div>
                            <div class="skill-tags">
                                <span class="skill-tag seek-tag">日语</span>
                                <span class="skill-tag seek-tag">摄影</span>
                            </div>
                        </div>
                    </div>
                </div>
                
                <div class="card-actions">
                    <div class="post-time">发布于 昨天</div>
                    <button class="contact-btn">联系TA</button>
                </div>
            </div>
        </div>
        
        <!-- 单图技能卡片 -->
        <div class="skill-card single-media">
            <div class="media-area">
                <img src="https://picsum.photos/id/1060/600/400" alt="瑜伽教学" class="media-img">
            </div>
            
            <div class="card-content">
                <div class="user-info">
                    <div class="avatar-name">
                        <img src="https://picsum.photos/id/237/100/100" alt="刘瑜伽" class="user-avatar">
                        <div>
                            <div class="user-name">刘瑜伽</div>
                            <div class="user-meta">瑜伽教练 • 28岁</div>
                        </div>
                    </div>
                    <div class="distance">5.8公里</div>
                </div>
                
                <div class="skill-info">
                    <div class="skill-title">瑜伽教学（初级到中级）</div>
                    <div class="skill-description">
                        国际认证瑜伽教练，擅长哈他瑜伽和流瑜伽，可教授呼吸法、体式和冥想技巧，适合初学者入门。
                    </div>
                    
                    <div class="skills-exchange">
                        <div class="skill-offer">
                            <div class="skill-label">我能提供</div>
                            <div class="skill-tags">
                                <span class="skill-tag offer-tag">瑜伽基础</span>
                                <span class="skill-tag offer-tag">冥想技巧</span>
                                <span class="skill-tag offer-tag">普拉提</span>
                            </div>
                        </div>
                        
                        <div class="skill-seek">
                            <div class="skill-label">我想学习</div>
                            <div class="skill-tags">
                                <span class="skill-tag seek-tag">绘画</span>
                                <span class="skill-tag seek-tag">烘焙</span>
                            </div>
                        </div>
                    </div>
                </div>
                
                <div class="card-actions">
                    <div class="post-time">发布于 3天前</div>
                    <button class="contact-btn">联系TA</button>
                </div>
            </div>
        </div>
        
        <!-- 无图技能卡片 -->
        <div class="skill-card no-media">
            <div class="media-area">
                <div class="skill-icon">
                    <i class="fas fa-language"></i>
                </div>
                <div class="skill-category">语言学习</div>
            </div>
            
            <div class="card-content">
                <div class="user-info">
                    <div class="avatar-name">
                        <img src="https://picsum.photos/id/342/100/100" alt="王外语" class="user-avatar">
                        <div>
                            <div class="user-name">王外语</div>
                            <div class="user-meta">英语教师 • 35岁</div>
                        </div>
                    </div>
                    <div class="distance">2.7公里</div>
                </div>
                
                <div class="skill-info">
                    <div class="skill-title">英语口语与写作辅导</div>
                    <div class="skill-description">
                        英语专业八级，10年教学经验，可辅导日常口语、商务英语和学术写作，提供雅思托福备考指导。
                    </div>
                    
                    <div class="skills-exchange">
                        <div class="skill-offer">
                            <div class="skill-label">我能提供</div>
                            <div class="skill-tags">
                                <span class="skill-tag offer-tag">英语口语</span>
                                <span class="skill-tag offer-tag">英语写作</span>
                                <span class="skill-tag offer-tag">雅思辅导</span>
                            </div>
                        </div>
                        
                        <div class="skill-seek">
                            <div class="skill-label">我想学习</div>
                            <div class="skill-tags">
                                <span class="skill-tag seek-tag">中国书法</span>
                                <span class="skill-tag seek-tag">太极拳</span>
                            </div>
                        </div>
                    </div>
                </div>
                
                <div class="card-actions">
                    <div class="post-time">发布于 1周前</div>
                    <button class="contact-btn">联系TA</button>
                </div>
            </div>
        </div>
        
        <!-- 多图技能卡片 -->
        <div class="skill-card multiple-media">
            <div class="media-area">
                <div class="media-grid">
                    <img src="https://picsum.photos/id/96/300/300" alt="摄影作品1" class="grid-img">
                    <img src="https://picsum.photos/id/26/300/300" alt="摄影作品2" class="grid-img">
                    <img src="https://picsum.photos/id/65/300/300" alt="摄影作品3" class="grid-img">
                </div>
            </div>
            
            <div class="card-content">
                <div class="user-info">
                    <div class="avatar-name">
                        <img src="https://picsum.photos/id/399/100/100" alt="陈摄影" class="user-avatar">
                        <div>
                            <div class="user-name">陈摄影</div>
                            <div class="user-meta">摄影师 • 32岁</div>
                        </div>
                    </div>
                    <div class="distance">7.3公里</div>
                </div>
                
                <div class="skill-info">
                    <div class="skill-title">摄影技巧与后期修图教学</div>
                    <div class="skill-description">
                        专业摄影师，擅长人像、风光和街头摄影，可教授构图、用光技巧，以及Lightroom/PS后期处理。
                    </div>
                    
                    <div class="skills-exchange">
                        <div class="skill-offer">
                            <div class="skill-label">我能提供</div>
                            <div class="skill-tags">
                                <span class="skill-tag offer-tag">摄影技巧</span>
                                <span class="skill-tag offer-tag">后期修图</span>
                                <span class="skill-tag offer-tag">器材选择</span>
                            </div>
                        </div>
                        
                        <div class="skill-seek">
                            <div class="skill-label">我想学习</div>
                            <div class="skill-tags">
                                <span class="skill-tag seek-tag">钢琴</span>
                                <span class="skill-tag seek-tag">法语</span>
                            </div>
                        </div>
                    </div>
                </div>
                
                <div class="card-actions">
                    <div class="post-time">发布于 4天前</div>
                    <button class="contact-btn">联系TA</button>
                </div>
            </div>
        </div>
    </div>
    
    <!-- 底部导航 -->
    <div class="bottom-nav">
        <a href="#" class="nav-item">
            <i class="fas fa-home"></i>
            <span>首页</span>
        </a>
        <a href="#" class="nav-item active">
            <i class="fas fa-exchange-alt"></i>
            <span>技能交换</span>
        </a>
        <a href="#" class="nav-item">
            <i class="fas fa-plus-circle"></i>
            <span>发布</span>
        </a>
        <a href="#" class="nav-item">
            <i class="fas fa-comment"></i>
            <span>消息</span>
        </a>
        <a href="#" class="nav-item">
            <i class="fas fa-user"></i>
            <span>我的</span>
        </a>
    </div>
    
    <!-- 发布新技能悬浮按钮 -->
    <button class="floating-btn" id="postBtn">
        <i class="fas fa-plus"></i>
    </button>
    
    <!-- 提示消息 -->
    <div class="toast" id="toastMessage"></div>
    
    <!-- Bootstrap JS Bundle with Popper -->
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
    
    <script>
        // DOM元素
        const backBtn = document.getElementById('backBtn');
        const filterBtn = document.getElementById('filterBtn');
        const postBtn = document.getElementById('postBtn');
        const filterTags = document.querySelectorAll('.filter-tag');
        const viewBtns = document.querySelectorAll('.view-btn');
        const contactBtns = document.querySelectorAll('.contact-btn');
        const searchInput = document.querySelector('.search-input');
        const toastMessage = document.getElementById('toastMessage');
        
        // 初始化
        function init() {
            setupEventListeners();
        }
        
        // 设置事件监听
        function setupEventListeners() {
            // 返回按钮
            backBtn.addEventListener('click', () => {
                showToast('返回上一页');
            });
            
            // 筛选按钮
            filterBtn.addEventListener('click', () => {
                showToast('打开筛选面板');
            });
            
            // 发布按钮
            postBtn.addEventListener('click', () => {
                showToast('发布新的技能交换');
            });
            
            // 筛选标签切换
            filterTags.forEach(tag => {
                tag.addEventListener('click', () => {
                    filterTags.forEach(t => t.classList.remove('active'));
                    tag.classList.add('active');
                    showToast(`已筛选: ${tag.textContent}`);
                });
            });
            
            // 视图切换
            viewBtns.forEach(btn => {
                btn.addEventListener('click', () => {
                    const viewType = btn.getAttribute('data-view');
                    
                    viewBtns.forEach(b => b.classList.remove('active'));
                    btn.classList.add('active');
                    
                    // 移除所有视图类
                    document.body.classList.remove('list-view', 'grid-view');
                    
                    // 添加当前视图类
                    if (viewType === 'list') {
                        document.body.classList.add('list-view');
                    } else if (viewType === 'grid') {
                        document.body.classList.add('grid-view');
                    }
                    
                    showToast(`${btn.title}`);
                });
            });
            
            // 联系按钮
            contactBtns.forEach(btn => {
                btn.addEventListener('click', function() {
                    const userName = this.closest('.card-content').querySelector('.user-name').textContent;
                    showToast(`正在联系 ${userName}`);
                });
            });
            
            // 搜索功能
            searchInput.addEventListener('keyup', function(e) {
                if (e.key === 'Enter') {
                    const searchText = this.value.trim();
                    if (searchText) {
                        showToast(`搜索技能: ${searchText}`);
                    } else {
                        showToast('请输入搜索内容');
                    }
                }
            });
        }
        
        // 显示提示消息
        function showToast(message) {
            toastMessage.textContent = message;
            toastMessage.classList.add('show');
            setTimeout(() => {
                toastMessage.classList.remove('show');
            }, 2000);
        }
        
        // 初始化页面
        document.addEventListener('DOMContentLoaded', init);
    </script>
</body>
</html>
